<?php

namespace app\index\controller;

use app\common\controller\Frontend;
use think\Db;

class Lookout extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';

    public function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {
        $list = Db::name('lookout')->where(['status' => 1])->field('id, cover, title')->paginate(8);
        $this->assign('list', $list);
        $this->assign('title', '商情瞭望');
        return $this->view->fetch();
    }

    public function info($id)
    {
        $info = Db::name('lookout')->where(['status' => 1, 'id' => $id])->find();
        if(!$info) {
            $this->error('页面不存在');
        }
        $this->assign('info', $info);
        $this->assign('title', $info['title']);
        return $this->view->fetch();
    }

}
